Skip to content

feat(mcp): add gittensory_find_opportunities tool to the hosted /mcp Worker - #2789

Closed
ai-mountain wants to merge 14 commits into
JSONbored:mainfrom
ai-mountain:feat/mcp-hosted-find-opportunities-2308
Closed

feat(mcp): add gittensory_find_opportunities tool to the hosted /mcp Worker#2789
ai-mountain wants to merge 14 commits into
JSONbored:mainfrom
ai-mountain:feat/mcp-hosted-find-opportunities-2308

Conversation

@ai-mountain

Copy link
Copy Markdown
Contributor

Closes #2308.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.14%. Comparing base (d6daf68) to head (b221949).
⚠️ Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
src/mcp/server.ts 93.10% 0 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (93.10%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2789   +/-   ##
=======================================
  Coverage   96.13%   96.14%           
=======================================
  Files         248      248           
  Lines       27572    27601   +29     
  Branches    10014    10025   +11     
=======================================
+ Hits        26506    26536   +30     
+ Misses        443      438    -5     
- Partials      623      627    +4     
Files with missing lines Coverage Δ
src/mcp/server.ts 95.69% <93.10%> (-0.12%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 3, 2026
@loopover-orb

loopover-orb Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-04 00:57:29 UTC

3 files · 1 AI reviewer · 1 blocker · readiness 80/100 · CI failing · blocked

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: src/mcp/server.ts:2089 makes `targets` optional in the MCP input but `findOpportunities` immediately returns `validation_error` when no targets are provided, so `gittensory_find_opportunities` cannot perform the advertised cross-repo discovery/search flow unless the caller already knows every repo to query. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
The diff wires a new hosted MCP opportunity-discovery tool, validates its basic input/output shape, and backs it with repository issue/PR samples plus a deterministic score calculation. The registration and basic access gating are coherent, but the implementation only supports explicit target repos even though the schema and tool description advertise broader cross-repo discovery; callers that provide only a search query get a validation-style result instead of discovery. The added tests cover happy paths and filters, but some assertions are too weak to prove the duplicate-risk behavior they name.

Blockers

  • src/mcp/server.ts:2089 makes `targets` optional in the MCP input but `findOpportunities` immediately returns `validation_error` when no targets are provided, so `gittensory_find_opportunities` cannot perform the advertised cross-repo discovery/search flow unless the caller already knows every repo to query.
Nits — 5 non-blocking
  • test/unit/mcp-output-schemas.test.ts:401 names the duplicate-risk behavior but only checks that `dupRisk` is a number, so it would pass if claimed and unclaimed issues received the same value.
  • src/mcp/server.ts:2143 reports `${repos.length}` in the summary even though processing is capped with `repos.slice(0, 20)`, which can overstate how many repositories were actually searched.
  • src/mcp/server.ts:2114 uses a far-future fallback for missing `updatedAt`, making unknown freshness look perfect; use a neutral or stale fallback unless that convention is intentional.
  • Either make `targets` required in `findOpportunitiesShape` and update the description to say this is target-scoped, or implement the registered-repo fanout path when only `searchQuery` is provided.
  • Strengthen the duplicate-risk test by inserting both claimed and unclaimed open issues and asserting the claimed issue has `dupRisk` greater than the unclaimed one.

Why this is blocked

  • src/mcp/server.ts:2089 makes `targets` optional in the MCP input but `findOpportunities` immediately returns `validation_error` when no targets are provided, so `gittensory_find_opportunities` cannot perform the advertised cross-repo discovery/search flow unless the caller already knows every repo to query.

CI checks failing

  • codecov/patch — 93.10% of diff hit (target 99.00%)
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #2308
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 113 registered-repo PR(s), 63 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RenzoMXD; Gittensor profile; 113 PR(s), 7 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: RenzoMXD
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 113 PR(s), 7 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

…Worker

Register gittensory_find_opportunities in the hosted MCP server composing
the ranker from gittensory-engine into a single advisory, metadata-only,
no-writes tool call. Accepts a repo target list or search query plus an
optional MinerGoalSpec (lane, minRankScore, languages) and a result cap.

For each target repo, reads cached open issues and open PRs, computes
dupRisk from linked-issue claim overlap, freshness from issue age, and
a composite rankScore via rankOpportunityScore. Returns a public-safe
ranked array (owner, repo, issueNumber, title, rankScore, laneFit,
freshness, dupRisk, aiPolicyAllowed) sorted by rankScore descending.

Closes JSONbored#2308
@ai-mountain ai-mountain closed this Jul 3, 2026
@ai-mountain ai-mountain reopened this Jul 3, 2026
@ai-mountain
ai-mountain force-pushed the feat/mcp-hosted-find-opportunities-2308 branch from 9acc926 to 6ada8ce Compare July 3, 2026 20:45
@ai-mountain
ai-mountain marked this pull request as ready for review July 3, 2026 20:46

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 2 security concern(s).

Comment thread src/mcp/server.ts
Comment thread src/mcp/server.ts
@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. label Jul 3, 2026
@superagent-security superagent-security Bot removed the pr:flagged PR flagged for review by security analysis. label Jul 3, 2026
@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. label Jul 3, 2026
@superagent-security superagent-security Bot removed the pr:flagged PR flagged for review by security analysis. label Jul 3, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch); AI reviewers agree on a likely critical defect: src/mcp/server.ts:2089 makes `targets` optional in the MCP input but `findOpportunities` immediately returns `validation_error` when no targets are provided, so `gittensory_find_opportunities` cannot perform the advertised cross-repo discovery/search flow unless the caller already knows every repo to query.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs are re-reviewed automatically, so an inaccurate close may be reopened, but that does not guarantee it can merge (e.g. if conflicts or failing CI remain).

@loopover-orb loopover-orb Bot closed this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): add gittensory_find_opportunities tool to the hosted /mcp Worker

1 participant